import httpInstance from "@/utils/http";

export function getTopCategoryAPI(id) {
  return httpInstance({
    url: "/category",
    params: {
      id,
    },
  });
}

// 二级分类

export function getCategoryFilterAPI(id) {
  return httpInstance({
    url: "/category/sub/filter",
    params: {
      id,
    },
  });
}

/**
 * @data {
 *  categoryId:1005000,
 *  page: 1,
 *  pageSize: 20,
 *  sortField:'publishTime' | 'orderNum' | 'evaluateNum'
 * }
 * @return {*}
 */
export function getSubCategoryAPI(data) {
  return httpInstance({
    url: "/category/goods/temporary",
    method: "POST",
    data,
  });
}
